using System;
using System.ComponentModel;

namespace SBPweb.Contracts.StateManagement
{
	public class StateEventArgs : EventArgs
	{

		private State pNewState;
		private State pOldState;
		private bool pIsLocked;
		private TimeSpan pTimeout;
		private object pChangedBy;

		public StateEventArgs(State newState, State oldState, bool isLocked, TimeSpan timeout, object changedBy)
		{
			pNewState = newState;
			pOldState = oldState;
			pIsLocked = isLocked;
			pTimeout = timeout;
			pChangedBy = changedBy;
		}

		public State NewState
		{
			get
			{
				return pNewState;
			}
			set
			{
				pNewState = value;
			}
		}

		public State OldState
		{
			get
			{
				return pOldState;
			}
		}

		public bool IsLocked
		{
			get
			{
				return pIsLocked;
			}
		}

		public TimeSpan Timeout
		{
			get
			{
				return pTimeout;
			}
		}

		public object ChangedBy
		{
			get
			{
				return pChangedBy;
			}
		}

	}

	public class StateChangingEventArgs : CancelEventArgs
	{

		private State pNewState;
		private State pOldState;
		private bool pIsLocked;
		private TimeSpan pTimeout;
		private object pChangedBy;

		public StateChangingEventArgs(State newState, State oldState, bool isLocked, TimeSpan timeout, object changedBy)
		{
			pNewState = newState;
			pOldState = oldState;
			pIsLocked = isLocked;
			pTimeout = timeout;
			pChangedBy = changedBy;
		}

		public State NewState
		{
			get
			{
				return pNewState;
			}
			set
			{
				pNewState = value;
			}
		}

		public State OldState
		{
			get
			{
				return pOldState;
			}
		}

		public bool IsLocked
		{
			get
			{
				return pIsLocked;
			}
		}

		public TimeSpan Timeout
		{
			get
			{
				return pTimeout;
			}
		}

		public object ChangedBy
		{
			get
			{
				return pChangedBy;
			}
		}

	}

}